ErrorLevel("off")
MortScript = "\DiskOnChip\MortScript"
BACKUP_PATH = "\Storage Card\InstallSD\BackupBDR"
L = "\DiskOnChip\MortScript\Sav_list.txt"
STANDARD_MEMORY = 5000
BACKUP_MEMORY = 22000
SET SAVEREG, %MORTSCRIPT%&"\savereg.exe"
SET SETMEM, %MORTSCRIPT%&"\SetMem.exe"
Stmp = "\Temp"
Set REGBACKUP, %BACKUP_PATH%&"\backup.rbk"

If( question( "Voulez-vous sauvegarder la Base de Registre ?" ) )
	Call Backup
Else
	Message( "Restauration interrompue" )
EndIf
Exit
Sub Backup
Run (%SETMEM%, "22000")

If (not DirExists (%BACKUP_PATH%))
	MkDir (%BACKUP_PATH%)
EndIf

sleep 300

If (not DirExists (%Stmp%))
	MkDir (%Stmp%)
EndIf
If (fileExists(%REGBACKUP%))
	Rename(%REGBACKUP%,%REGBACKUP% & ".old",1)
EndIf
Run (%SAVEREG%,"s " & %REGBACKUP%)
Run (%SETMEM%, %STANDARD_MEMORY%)
Message( "Sauvegarde de la Base de Registre terminée." )
EndSub
Exit